<?php

class Gmapsprofile_View_Helper_GmapsprofileReport extends Zend_View_Helper_Abstract
{
 
  public function gmapsprofileReport($subject, $label = false, $viewer = null)
  {
    $class = $label ? 'buttonlink' : 'buttonlink_members_gmap';
	$label = !$label ? '' : $this->view->translate('Report');
    $viewer = Engine_Api::_()->user()->getViewer();

    if( !$viewer->getIdentity() || !$subject->getIdentity() || $viewer->isSelf($subject) )
    {
      return false;
    }

    else
    {
      return $this->view->htmlLink(array('route' => 'default', 'module' => 'core', 'controller' => 'report', 'action' => 'create', 'subject' => $subject->getGuid()), $label, array(
          'class' => $class. ' icon_report', 'title' => $this->view->translate('Report'), 'onclick' => "parent.Smoothbox.open(this.href); return false;"
        ));	
    }
  }  
}